#include<bits/stdc++.h>
using namespace std;
const int SIZE = 100005;
unordered_map<int, int>mp;
int n, a[SIZE], out[SIZE], ans;
int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    mp[a[1]] = 0;
    for (int i = 1; i < n; i++) {
        if (a[i + 1] != a[i]) mp[a[i + 1]] = i;
    }
    for (int i = 1; i <= n; i++) {
        out[mp[a[i]]] = 1;
        mp[a[i]] --;
    }
    for (int i = 1; i <= n; i++) ans += !(out[i]);
    cout << ans;
}
// n log n
